/*
 * Team Name: Team Sasquatch
 * Cody Sharff
 * Anthony Rios
 * Prince Kishore
 * Travis Drake
 */

package model;

/**
 * Enum for UserTypes. Contains a method for converting a string to a usertype.
 * 
 * @author Travis Drake
 * 
 * @version May 19, 2012
 */
public enum UserType {
	AUCTION_CENTRAL, NPO, BIDDER;
	

	/**
	 * Returns the UserType enumeration in string form.
	 */
    public static UserType getType(String the_string) {
        UserType matched_type = null;
        if (the_string.equalsIgnoreCase(AUCTION_CENTRAL.toString())) {
            matched_type = AUCTION_CENTRAL;
        } else if (the_string.equalsIgnoreCase(NPO.toString())) {
            matched_type = NPO;
        } else if (the_string.equalsIgnoreCase(BIDDER.toString())) {
            matched_type = BIDDER;
        } 
        return matched_type;
    }
}

